package com.qidian.mes.controller;

import com.qidian.mes.pojo.ProcessContent;
import com.qidian.mes.service.ProcessContentService;
import com.qidian.mes.util.pojo.MESResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


@RestController
@RequestMapping("/processContent")
@CrossOrigin
public class ProcessContentController {
    @Autowired
    private ProcessContentService processContentService;

    @GetMapping("/list")
    public MESResult list(Long processId){
        return processContentService.list(processId);
    }

    @PostMapping("/save")
    public MESResult save(@RequestBody ProcessContent processContent){
        return processContentService.save(processContent);
    }

    @DeleteMapping("/delete")
    public MESResult delete(Long contentId){
        return processContentService.delete(contentId);
    }

    @GetMapping("/get")
    public MESResult get(Long contentId){
        return processContentService.get(contentId);
    }
    @PutMapping("/update")
    public MESResult update(@RequestBody ProcessContent processContent){
        return processContentService.update(processContent);
    }
}
